package com.i2863.receipt;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 修改启动类，继承 SpringBootServletInitializer 并重写 configure 方法
 * @author ZSX
 * tips: springboot 1.5.x版本后
 * import org.springframework.boot.context.web.SpringBootServletInitializer;
 * 改为
 * import org.springframework.boot.web.support.SpringBootServletInitializer;
 */
@RestController
@SpringBootApplication
@EnableTransactionManagement
@EnableAutoConfiguration
public class Application{
	
	@RequestMapping("/hello")
	public String hello(){
		return "hello World!!!";
	}


	public static void main(String[] args) {
		ApplicationContext  ctx = SpringApplication.run(Application.class, args);
//		String[] beanNames =  ctx.getBeanDefinitionNames();
//	       System.out.println("所以beanNames个数："+beanNames.length);
//	       for(String bn:beanNames){
//	           System.out.println(bn);
//	}
}
}
